//
//  TIMAddGroupTabCell.m
//  Demo_sdk
//
//  Created by Deli Xia on 2018/7/2.
//  Copyright © 2018年 Deli Xia. All rights reserved.
//

#import "TIMAddGroupTabCell.h"
#import "TIMDemoMacro.h"

@implementation TIMAddGroupTabCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        //布局View
        //        self.contentView.backgroundColor = [UIColor redColor];
        [self setUpView];
    }
    return self;
}

#pragma mark - setUpView
- (void)setUpView{
    
    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
    //勾选框
    [self.contentView addSubview:self.selectBtn];
    //头像
    [self.contentView addSubview:self.headImageView];
    //姓名
    [self.contentView addSubview:self.nameLabel];
    
}

- (UIButton *)selectBtn{
    if (!_selectBtn) {
        _selectBtn = [[UIButton alloc] initWithFrame:CGRectMake(15, 16, 20, 20)];
        [_selectBtn setImage:[UIImage imageNamed:@"addGroup_Select_NO"] forState:UIControlStateNormal];
        [_selectBtn setImage:[UIImage imageNamed:@"addGroup_Select_YES"] forState:UIControlStateSelected];
        
    }
    return _selectBtn;
}

- (UIImageView *)headImageView{
    if (!_headImageView) {
        _headImageView=[[UIImageView alloc]initWithFrame:CGRectMake(49, 11, 30, 30)];
        _headImageView.layer.masksToBounds = YES;
        _headImageView.layer.cornerRadius = 30/2;
        [_headImageView setContentMode:UIViewContentModeScaleAspectFill];
    }
    return _headImageView;
}

- (UILabel *)nameLabel{
    if (!_nameLabel) {
        _nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(93, 0, Screen_Width-100, 52)];
        [_nameLabel setFont:TPSFontSize(14)];
        _nameLabel.textColor = RGBColor(51, 51, 51);
    }
    return _nameLabel;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}


@end
